import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';

// import vuetify from '@/plugins/vuetify'; // path to vuetify export

// 导入自定义可拖动盒子的指令
import drag from './plugins/drag.js';

import './assets/css/common.css';

import './plugins/element.js';
import 'element-ui/lib/theme-chalk/index.css';

// 替换div 使折叠菜单生效
import Fragment from 'vue-fragment';

Vue.use(drag);

Vue.use(Fragment.Plugin);

// 时间格式化
function add0(val) {
    return val < 10 ? '0' + val : val;
}

Vue.prototype.$timeFormate = function(theDate) {
    let time = new Date(theDate);
    let y = time.getFullYear();
    let m = time.getMonth() + 1;
    let d = time.getDate();
    let h = time.getHours();
    let mm = time.getMinutes();
    let s = time.getSeconds();
    return (
        y +
        '-' +
        add0(m) +
        '-' +
        add0(d) +
        ' ' +
        add0(h) +
        ':' +
        add0(mm) +
        ':' +
        add0(s)
    );
};

Vue.config.productionTip = false;

new Vue({
    router,
    store,
    // vuetify,
    render: (h) => h(App)
}).$mount('#app');
